package com.zhou.bpm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhou.bpm.domain.dto.WorkspaceRequest;
import com.zhou.bpm.domain.vo.HistoryVo;
import com.zhou.bpm.domain.vo.WorkspaceVo;
import com.zhou.bpm.entity.BpmTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: zhoujinchuan
 * @Description: TODO（请添加描述）
 * @CreateTime: 2023/10/25 9:36
 */
@Mapper
public interface BpmTaskMapper extends BaseMapper<BpmTask> {

    /**
     * 整个审批流程信息
     *
     * @param instanceId
     * @return
     */
    List<HistoryVo> approvalProcess(@Param("processCode") String processCode, @Param("instanceId") Integer instanceId);

    /**
     * 待办列表
     * @param page
     * @param accountCode
     * @param workspaceRequest
     * @return
     */
    List<WorkspaceVo> pageQueryTodoList(@Param("page") Page<BpmTask> page,
                                        @Param("accountCode") Integer accountCode,
                                        @Param("workspaceRequest") WorkspaceRequest workspaceRequest);

    /**
     * 已办列表
     * @param page
     * @param accountCode
     * @param workspaceRequest
     * @return
     */
    List<WorkspaceVo> pageQueryApproved(@Param("page") Page<BpmTask> page,
                                        @Param("accountCode") Integer accountCode,
                                        @Param("workspaceRequest") WorkspaceRequest workspaceRequest);

    /**
     * 申请列表
     * @param page
     * @param accountCode
     * @param workspaceRequest
     * @return
     */
    List<WorkspaceVo> pageQueryApply(@Param("page") Page<BpmTask> page,
                                     @Param("accountCode") Integer accountCode,
                                     @Param("workspaceRequest") WorkspaceRequest workspaceRequest);
}
